package org.test.client.ui.content.uifeature;

import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Color;
import java.awt.FlowLayout;

import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

import org.test.client.ui.ContentMain;
import org.test.client.ui.component.MyBasePanel;
import org.test.client.ui.component.panel.TitlePanePanel;
import org.test.client.ui.util.VFlowLayout;

public class UIFeature extends MyBasePanel{

	public static final String PK = "UIFeature";
	
	public UIFeature() {
		
		doInit();
	}
	
	public UIFeature(ContentMain contentMain) {
		super(contentMain);
		this.setBackground(Color.red);
		this.add(new JLabel(PK));
	}
	
	@Override
	public MyBasePanel doInit() {
		JPanel mainPanel = new JPanel();
		mainPanel.setLayout(new VFlowLayout(5));
		
		BEButtonPanel btnPanel2 = new BEButtonPanel();
		mainPanel.add(btnPanel2);
		
		ToolTipPanel toolTip = new ToolTipPanel();
		mainPanel.add(toolTip);

		PopUpInfoPanel popup = new PopUpInfoPanel();
		mainPanel.add(popup);
		
		
		JScrollPane scrollPane = new JScrollPane(mainPanel);
		scrollPane.getVerticalScrollBar().setUnitIncrement(15);

		
		TitlePanePanel titlePanePanel = new TitlePanePanel("Text Field", "fa-certificate").doInit();
		titlePanePanel.setLayout(new BorderLayout());
		titlePanePanel.add(new TxtFieldPanel());
		mainPanel.add(titlePanePanel);
		
		
		TitlePanePanel btnPanel = new TitlePanePanel("Button", "fa-search-plus").doInit();
		btnPanel.setLayout(new BorderLayout());
		btnPanel.add(new ButtonPanel());
		mainPanel.add(btnPanel);
		
		this.setLayout(new BorderLayout());
		this.add(scrollPane);
		return this;
	}
	
	@Override
	public String getPanelKey() {
		return PK;
	}
	
}
